// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   CustomSSLSocketFactory.java

package com.boci.common.handler;

import java.io.IOException;
import java.net.*;
import javax.net.ssl.SSLSocketFactory;

final class CustomSSLSocketFactory extends SSLSocketFactory
{

    public CustomSSLSocketFactory(SSLSocketFactory originalFactory, int timeout)
    {
        this.originalFactory = originalFactory;
        socketTimeout = timeout;
    }

    public String[] getDefaultCipherSuites()
    {
        return originalFactory.getDefaultCipherSuites();
    }

    public String[] getSupportedCipherSuites()
    {
        return originalFactory.getSupportedCipherSuites();
    }

    public Socket createSocket(Socket s, String host, int port, boolean autoClose)
        throws IOException
    {
        Socket socket = originalFactory.createSocket(s, host, port, autoClose);
        socket.setSoTimeout(socketTimeout);
        return socket;
    }

    public Socket createSocket(String host, int port)
        throws IOException, UnknownHostException
    {
        Socket socket = originalFactory.createSocket(host, port);
        socket.setSoTimeout(socketTimeout);
        return socket;
    }

    public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
        throws IOException, UnknownHostException
    {
        Socket socket = originalFactory.createSocket(host, port, localHost, localPort);
        socket.setSoTimeout(socketTimeout);
        return socket;
    }

    public Socket createSocket(InetAddress host, int port)
        throws IOException
    {
        Socket socket = originalFactory.createSocket(host, port);
        socket.setSoTimeout(socketTimeout);
        return socket;
    }

    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
        throws IOException
    {
        Socket socket = originalFactory.createSocket(address, port, localAddress, localPort);
        socket.setSoTimeout(socketTimeout);
        return socket;
    }

    private SSLSocketFactory originalFactory;
    private int socketTimeout;
}
